#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<pthread.h>

void* thrad(void* argv)
{
    printf("thread is return.....\n");
    
    pthread_detach(pthread_self());
    return NULL;

}

int main()
{
    pthread_t td;
    int n;

    if(pthread_create(&td,NULL,thrad,NULL)!=0)
    {
        perror("pthread_create is error\n");
        exit(1);
    }
    sleep(1);

    if(pthread_join(td,NULL)==0)
    {
        printf("pthread_join and pthread _death is right\n");
    }
    else{
        printf("just pthread _death is right\n");
    }

    return 0;
}